home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / util / stdm15.zip / ADDON.TXT next >
Text File  |  1994-12-16  |  11KB  |  305 lines

  1. Description of the add-on to StDemo Player
  2. ==========================================
  3.  
  4. The feature described below is not included in the shareware
  5. version of StDemo Player. If you are interested in this add-on,
  6. you may order it when you register StDemo Player.
  7.  
  8. Professional version doesn't impose limits on keyboard/mouse simulation.
  9. In "standard" version some keys are impossible to simulate (for example, 
  10. pressing Alt alone, i.e. not as a modifier to some other key) and mouse 
  11. simulation is limited to the client area of a window only. There are
  12. some other cases when mouse simulation wouldn't work, drag-and-drop from 
  13. File Manager, for instance. Professional version allows any simulation.
  14.  
  15. StDemo Pro allows to simulate all keyboard and mouse events using Windows
  16. journal capabilities. The command to use is:
  17.  
  18. :"<string>
  19.  
  20. <string> contains the list of codes which describe desired actions.
  21.  
  22. Keyboard events are simulated by sending one or more keystrokes to the 
  23. active window as if they had been entered at the keyboard.
  24. Each key is represented by one or more characters.  To specify a single 
  25. keyboard character, use the character itself.  For example, to represent the 
  26. letter a, use "a" for <string>.  If you want to represent more than one character,
  27. append each additional character to the one preceding it.  To represent the 
  28. letters a, B, and c, use "aBc" for <string>.
  29.  
  30. The plus sign (+), caret (^), percent sign (%), tilde (~), braces { }, 
  31. and parentheses ( ) have special meanings inside the <string>.  To specify one of these 
  32. characters, enclose it inside braces.  For example, to specify the plus sign, use {+}.  
  33. To send brace characters, use {{} and {}}.
  34.  
  35. To specify characters that aren't displayed when you press a key (such as 
  36. Enter or Tab) and keys that represent actions rather than characters, use the 
  37. codes shown below:
  38.  
  39. Key             Code
  40. ---             ----    
  41. Backspace       {BACKSPACE} or {BS} or {BKSP}    
  42. Break           {BREAK}
  43. Caps Lock       {CAPSLOCK}    
  44. Clear           {CLEAR}
  45. Del             {DELETE} or {DEL}    
  46. Down Arrow      {DOWN}
  47. End             {END}    
  48. Enter           {ENTER} or ~
  49. Esc             {ESCAPE} or {ESC}    
  50. Help            {HELP}
  51. Home            {HOME}    
  52. Ins             {INSERT}
  53. Left Arrow      {LEFT}    
  54. Num Lock        {NUMLOCK}
  55. Page Down       {PGDN}    
  56. Page Up         {PGUP}
  57. Print Screen    {PRTSC}    
  58. Right Arrow     {RIGHT}
  59. Scroll Lock     {SCROLLOCK}    
  60. Space           {Space} or {Blank}
  61. Tab             {TAB}
  62. Up Arrow        {UP}    
  63. F1              {F1}
  64. F2              {F2}    
  65. F3              {F3}
  66. F4              {F4}    
  67. F5              {F5}
  68. F6              {F6}    
  69. F7              {F7}
  70. F8              {F8}    
  71. F9              {F9}
  72. F10             {F10}    
  73. F11             {F11}
  74. F12             {F12}    
  75. F13             {F13}
  76. F14             {F14}    
  77. F15             {F15}
  78. F16             {F16}        
  79.  
  80. To specify keys combined with any combination of Shift, Ctrl, and Alt keys, 
  81. precede the regular key code with one or more of the following codes:
  82.  
  83. Key         Code
  84. ---         ----
  85. Shift       +
  86. Control     ^
  87. Alt         %
  88.  
  89. To specify that Shift, Ctrl, and/or Alt should be held down while several other 
  90. keys are pressed, enclose the keys' code in parentheses.  For example, to have 
  91. the Shift key held down while word "code" is being typed, use "+(code)". It has 
  92. the same effect as using "CODE". Pay attention to the case of the letters when using
  93. + modifier. It actually reverses the case. For example, +(CODE) will produce "code".
  94.  
  95. To have two modifiers to be applied to the keystroke, precede the keystroke with
  96. both, i.e. "^+{End}" means Ctrl-Shift-End.
  97.  
  98. To simulate pressing Shift, Alt or Ctrl alone use the form %(), +() or ^().
  99.  
  100. To specify repeating keys, use the form {key number};  you must put a space 
  101. between key and number.  For example, {LEFT 4} means press the Left 
  102. Arrow key 4 times; {SPACE 10} means press space 10 times; 
  103. {a 5} means press "a" 5 times.
  104.  
  105.  
  106. Mouse events are simulated by using one or more special codes in the
  107. <string>.
  108.  
  109. Action                          Code
  110. ------                          ----    
  111. LeftButtonClick                 {Lclick}
  112. RightButtonClick                {Rclick}
  113. MiddleButtonClick               {Mclick}
  114. MoveMouse                       {Move}
  115. DragWithLeftButton              {LDrag}
  116. DragWithRightButton             {RDrag}
  117. DragWithMiddleButton            {MDrag}
  118.  
  119.  
  120. "Drag" means moving the mouse with the button held pressed.
  121.  
  122. Double-click might be coded as {LClick 2}. Make sure that the current
  123. delay applied between events is small enough.
  124.  
  125. Mouse move and drag commands have "parameters" coded as numbers separated by space
  126. or "|" after the code inside the braces. First two represent the X and Y coordinates
  127. of the point where mouse movement ends. (It starts from the current cursor position).
  128. The third parameter (optional, 1 by default) shows in how many steps this movement
  129. will be executed, i.e. how many "jumps" mouse cursor will make.
  130.  
  131. The following example shows how to draw a square in the Paintbrush:
  132. {Move 200|200}{LDrag 300|200|2}{LDrag 300|300|2}{LDrag 200|300|2}{LDrag 200|200|2}
  133.  
  134. Coordinates may be expressed as "relative" if they are preceded with "+" or "-" sign.
  135. "*" represents the current coordinate.
  136.  
  137. The previous example might be modified as follows using relative coordinates:
  138. {Move 200|200}{LDrag +100|*|2}{LDrag *|+100|2}{LDrag -100|*|2}{LDrag *|-100|2}
  139.  
  140. Alt/Ctrl/Shift modifiers may be used with the mouse simulation codes in the same
  141. way as with the keyboard simulation codes.
  142.  
  143. When using coordinates, it is very important to understand and use the proper scheme 
  144. of coordinate origin and scaling. 
  145. Selecting appropriate coordinates origin allows to make your mouse simulation
  146. commands invariant to the window's position on a desktop.
  147. Selecting appropriate coordinates scaling allows to make your mouse simulation
  148. commands invariant to the window's size and/or the resolution of the screen.
  149.  
  150. There are some special codes to define origin and scaling.
  151.  
  152. Action                          Code
  153. ------                          ----    
  154. Set coordinate origin           {Origin}
  155. Set coordinates scaling         {Virtsize}
  156.  
  157. The following codes represent all possible cases of using coordinates origin:
  158.  
  159. {Origin Desktop}
  160.     The coordinates origin (0,0) is in the upper left corner of the desktop.
  161.  
  162. {Origin Window Active}
  163.     The coordinates origin (0,0) is in the upper left corner of the window area
  164.     of the currently active window.
  165.  
  166. {Origin Window Focus}
  167.     The coordinates origin (0,0) is in the upper left corner of the window area
  168.     of the window which currently owns focus.
  169.  
  170. {Origin Window Class|<classname>}
  171.     The coordinates origin (0,0) is in the upper left corner of the window area
  172.     of the window which classname matches given <classname> string. 
  173.  
  174. {Origin Window Caption|<caption>}
  175.     The coordinates origin (0,0) is in the upper left corner of the window area
  176.     of the window which caption matches given <caption> string. 
  177.  
  178. {Origin Client Active}
  179. {Origin Client Focus}
  180. {Origin Client Class|<classname>}
  181. {Origin Client Caption|<caption>}
  182.     All these cases are the same as for "Window" but the origin starts in the upper left
  183.     corner of the client area.
  184.     
  185. Coordinates scaling might be defined using the following form:
  186.  
  187. {VirtSize X|Y}
  188.  
  189. where X and Y are numbers representing the virtual size of the area chosen by
  190. {Origin} command. For example, if origin refers to the desktop - virtual size
  191. defines the size of the screen, if origin is "window" - virtual size refers
  192. to the size of the window area, if origin is "Client" - virtual size refers to
  193. the size of a client area. 
  194.  
  195. If virtual size defined as {Virtsize *|*} then all coordinates are treated as
  196. absolute. This is the default setting for VirtSize. 
  197. Otherwise coordinates are scaled to the correspondent desktop/window/client
  198. virtual size.
  199.  
  200. For example, to divide the paint area of the PaintBrush into four equal quarters, 
  201. the following sequence might be used:
  202.  
  203. :"{Origin Client Class|pbPaint}{VirtSize 1000 1000}{Move 0 500}{LDrag 1000 500}{Move 500 0}{LDrag 500 1000}
  204.  
  205. NOTE
  206. ----
  207.     {Origin} and {Virtsize} codes have LOCAL scope -- they affect only commands in the
  208. same :" line where they were coded. If subsequent :" commands don't have {Origin}/{VirtSize},
  209. GLOBAL values for them will be used. These global values are set with :O and :S
  210. commands. (Refer to the readme.txt).
  211.  
  212. Examples:
  213.  
  214. :OSWV
  215. :S1000|1000
  216. ....
  217. equal to
  218. :"{Origin Desktop}{VirtSize 1000 1000}.......
  219.  
  220.  
  221. :OACA
  222. ....
  223. equal to
  224. :"{Origin Client Active}{VirtSize *|*}.......
  225.  
  226.  
  227. :OFW
  228. :S100|100
  229. ....
  230. equal to 
  231. :"{Origin Window Focus}{VirtSize 100|100}.......
  232.  
  233.  
  234. The following example demonstrates using of the :" command...
  235.  
  236. ------------------cut here-------------------------
  237. :C11
  238. :I11
  239. :=100
  240. :(pbrush.exe
  241. :#S
  242. Let's draw some figures in Paintbrush
  243. #
  244. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 0 50}{LDrag 100 * 10}{Move 50 0}{LDrag * 100 10}
  245. // select circle tool
  246. :"{Origin Client Class|pbTool}{VirtSize 4 18}{Move 1 15}{LClick}
  247. // Draw several ellipses in different colors
  248. :"{Origin Client Class|pbColor}{VirtSize 32 4}{Move 9 1}{LClick}
  249. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 40 40}{LDrag 60 60}
  250. :"{Origin Client Class|pbColor}{VirtSize 32 4}{Move 11 1}{LClick}
  251. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 30 30}{LDrag 70 70 4}
  252. :"{Origin Client Class|pbColor}{VirtSize 32 4}{Move 13 3}{LClick}
  253. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 20 20}{LDrag 80 80 100}
  254. :#S
  255. Closing paintbrush
  256. #
  257. :"%fxn
  258. // LcalcDemo
  259. :#S
  260. The following is the "calc" sample from script.txt expressed with :" notation.
  261. .S
  262. Note using the :O and :S commands to set GLOBAL Origin and VirtSize.
  263. #
  264. :LcalcDemo
  265. :(calc.exe
  266. :S324|283
  267. :OFC
  268. // View->Standard
  269. :"%vt
  270. // Clear
  271. :#S
  272. I'm going to move the cursor to the 'CLEAR' button - and click.
  273. #
  274. :"{Move 0|0}{Move 38|66|30}{LClick}
  275. // click 2
  276. :#S
  277. Now I'm going to move the cursor to the '2' button - and click.
  278. #
  279. :"{Move 135|196|30}{LClick}
  280. // click *
  281. :#S
  282. Now I'll move to the '*' button - and click.
  283. #
  284. :"{Move 242|152|30}{LClick}
  285. // click 3
  286. :#S
  287. And here we go to the '3' button - and click.
  288. #
  289. :"{Move 189|196|30}{LClick}
  290. // click =
  291. :#S
  292. Now I'm going to click on '=' and, truly, I'm expecting to get....
  293. #
  294. :"{Move 295|240|30}{LClick}
  295. :#S
  296. Don't tell me that the result is not equal to six, please!
  297. #
  298. :"%E{Left}{Down 5}{Enter}
  299. :#S
  300. Calc must be closed now.
  301. .S
  302. That's all.
  303. #
  304. ------------------cut here-------------------------
  305.